package com.guaju.yueshangclothing.global;

import android.app.Application;

import com.litesuits.orm.LiteOrm;
import com.litesuits.orm.db.DataBaseConfig;
import com.tencent.bugly.crashreport.CrashReport;

/**
 * Created by guaju on 2018/9/10.
 */

public class MyApplication extends Application {
    static MyApplication app;
    static LiteOrm liteOrm;

    @Override
    public void onCreate() {
        super.onCreate();
        app=this;
        //bugly
        CrashReport.initCrashReport(getApplicationContext(), "93185f729f", true);
        //liteorm
        if (liteOrm==null){
            DataBaseConfig dataBaseConfig = new DataBaseConfig(this, "ysshg.db");
            dataBaseConfig.dbVersion=1;
            dataBaseConfig.onUpdateListener=null;
            liteOrm=LiteOrm.newSingleInstance(dataBaseConfig);
        }
        liteOrm.setDebugged(true);


    }
    public static MyApplication getApp(){
        return app;
    }
    public static LiteOrm getLiteOrm(){return liteOrm;}
}
